Skip to content

fix: Preload point cloud component metadata in reader#94

Merged
janickm merged 1 commit intoNVIDIA:mainfrom
janickm:dev/janickm/push-mmwmzrvmlkrz
May 7, 2026
Merged

fix: Preload point cloud component metadata in reader#94
janickm merged 1 commit intoNVIDIA:mainfrom
janickm:dev/janickm/push-mmwmzrvmlkrz

Conversation

@janickm
Copy link
Copy Markdown
Collaborator

@janickm janickm commented May 7, 2026

Avoid runtime re-reads if possible


This pull request refactors the initialization and property access patterns in the PointCloudsComponent class to improve efficiency and code clarity. The main change is the introduction of an explicit __init__ method that caches frequently accessed attributes, reducing repeated reads from the underlying data group.

Refactoring and performance improvements:

  • Added an __init__ method to the class to cache pc_timestamps_us, coordinate_unit, and attribute_schemas as instance variables, reducing repeated access to the underlying zarr.Group and improving performance.
  • Updated the coordinate_unit, pcs_count, pc_timestamps_us, and attribute_names properties to return values from the cached instance variables instead of reading from the group each time.
  • Modified the get_attribute_schema method to use the cached _attribute_schemas dictionary, ensuring consistent and efficient schema access.

Avoid runtime re-reads if possible
@janickm janickm self-assigned this May 7, 2026
@janickm janickm added the enhancement New feature or request label May 7, 2026
@janickm janickm enabled auto-merge (rebase) May 7, 2026 07:16
@janickm janickm disabled auto-merge May 7, 2026 07:24
@janickm janickm merged commit 13bbf78 into NVIDIA:main May 7, 2026
2 checks passed
@janickm janickm deleted the dev/janickm/push-mmwmzrvmlkrz branch May 7, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant